package java_0629;

import java.util.concurrent.BlockingQueue;
import java.util.concurrent.LinkedBlockingQueue;

public class BlockingQueueEg {
    public static void main(String[] args) throws InterruptedException {
        BlockingQueue<String> queue = new LinkedBlockingQueue<String>(10);
        //put方法带有阻塞功能，但是offer不带有
        queue.put("hello");
        String elem = queue.take();
        System.out.println(elem);
        String elem1 = queue.take();
        System.out.println(elem1);
    }
}
